package src.lab02.test36;

import java.util.*;

/**
 * Created by 林云志 on 2017/11/22.
 */
public class Student {
    public static void main(String[] args) {
        Map<String,String>map = new HashMap<>();
        int [] grade = new int[]{90,95,100,80,85,90,80,85,90,75,82,87,80,82,84};
        int [] grades = new int [5];
        int [] undergraduate = new int [3];
        int [] postgraduate = new int [2];



        int n = 0;
        for (int i = 0; i<13; i=i+3){

            grades[n]=(grade[i]+grade[i+1]+grade[i+2])/3;
            n++;
        }
        /*for (Integer a :grades){
            System.out.println(a);
        }*/
        n = 0;
        int i = 0;
        for(Map.Entry<String,String>entry:map.entrySet()){
            if (entry.getValue()=="本科生"){
                undergraduate [n] = grade[i];
                n++;

            }

        i++;

        }
        n = 0;
        i = 0;
        for(Map.Entry<String,String>entry:map.entrySet()){
            if (entry.getValue()=="研究生"){
                postgraduate[n] = grade[i];
                n++;
            }
            i++;
        }
        Undergraduate undergraduates = new Undergraduate(undergraduate[0]);
        Undergraduate undergraduates1 = new Undergraduate(undergraduate[1]);
        Undergraduate undergraduates2 = new Undergraduate(undergraduate[2]);
        Postgraduate postgraduate1 = new Postgraduate(postgraduate[0]);
        Postgraduate postgraduate2 = new Postgraduate(postgraduate[1]);
        for(Map.Entry<String,String>entry:map.entrySet()){
            System.out.println(entry.getKey()+" "+entry.getValue()+grade[n]);

        }


    }
}
